﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QAxWidget>
#include <QAxObject>
#include "xlsxdocument.h"
#include "xlsxconditionalformatting.h"
#include "housepropertyvo.h"
#include <qlist.h>
#include "xlsxdocument.h"

using namespace QXlsx;
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    QString orcfileUrl;//审批表文档位置
    QString dotWordUrl;//word样板位置
    QString dotExcelUrl;//excel样板位置
    QString targetUrl;//生成位置

    bool  ishasOrc;//是否已经有审批表
    //房间客户列表
    QList<HousePropertyVO*> HouseProList;

    Document* pExcelDot;

private slots:

    void on_Btnorc_clicked();

    void on_lineEdit_editingFinished();

    void on_BtnExcel_clicked();

    void on_BtnTarget_clicked();

    void on_BtnCreate_clicked();



    void on_BtnWord_clicked();

private:
    Ui::MainWindow *ui;
    QAxObject *pApplication;
    QAxObject *pWorkBooks;
    QAxObject *pWorkBoos;
    QAxObject *pSheets;
    QAxObject *pSheet;
    //Word
    QAxWidget *pWord;
    QAxObject *pDocuments;
    QAxObject *pDocument;

    //
    void createExcel(HousePropertyVO* vo);
    void createWord(HousePropertyVO* vo);
    int MoreCharToInt(QString value);
    QList<int> StrToInts(QString value);

    void WruteExcel(Worksheet *ws,QString wstr, QString pos, QString value);

    void WriteWord(QString pos,QString value);

    QString ConverToChinese(QString value);






};

#endif // MAINWINDOW_H
